using System;
using bitzhuwei.Compiler;

namespace bitzhuwei.AnsiCFormat {
    /// <summary>
    /// Correspond to the Vn node statement in the grammar(AnsiC).
    /// </summary>
    internal partial class Vnstatement : IFullFormat {
        // [172] statement = labeled_statement ;
        // [173] statement = compound_statement ;
        // [174] statement = expression_statement ;
        // [175] statement = selection_statement ;
        // [176] statement = iteration_statement ;
        // [177] statement = jump_statement ;


        private readonly IFullFormat complex;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;
        public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
            context.PrintBlanksAnd(this.complex, preConfig, writer);
        }


        // [172] statement = labeled_statement ;
        public Vnstatement(Vnlabeled_statement r0) {
            this.complex = new complex0(r0);
            this._scope = new TokenRange(r0);
        }
        class complex0 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnlabeled_statement r0;
            public complex0(Vnlabeled_statement r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [173] statement = compound_statement ;
        public Vnstatement(Vncompound_statement r0) {
            this.complex = new complex1(r0);
            this._scope = new TokenRange(r0);
        }
        class complex1 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vncompound_statement r0;
            public complex1(Vncompound_statement r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [174] statement = expression_statement ;
        public Vnstatement(Vnexpression_statement r0) {
            this.complex = new complex2(r0);
            this._scope = new TokenRange(r0);
        }
        class complex2 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnexpression_statement r0;
            public complex2(Vnexpression_statement r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [175] statement = selection_statement ;
        public Vnstatement(Vnselection_statement r0) {
            this.complex = new complex3(r0);
            this._scope = new TokenRange(r0);
        }
        class complex3 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnselection_statement r0;
            public complex3(Vnselection_statement r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [176] statement = iteration_statement ;
        public Vnstatement(Vniteration_statement r0) {
            this.complex = new complex4(r0);
            this._scope = new TokenRange(r0);
        }
        class complex4 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vniteration_statement r0;
            public complex4(Vniteration_statement r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [177] statement = jump_statement ;
        public Vnstatement(Vnjump_statement r0) {
            this.complex = new complex5(r0);
            this._scope = new TokenRange(r0);
        }
        class complex5 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnjump_statement r0;
            public complex5(Vnjump_statement r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }



    }
}
